import request from '@/utils/request';

// 菜单树
export async function getModuleTree(params) {
  return request('/resource/getModuleTree', {
    params,
  });
}

// 资源新增
export async function addResource(params) {
  return request('/resource/addResource', {
    method: 'post',
    params,
  });
}

// 批量停用启用
export async function batchDisabled({ id, ...params }) {
  return request('/resource/batchDisabled', {
    method: 'post',
    data: id,
    params,
  });
}

// 资源删除
export async function deleteResource({ id }) {
  return request('/resource/deleteResource', {
    method: 'post',
    data: id,
  });
}

// 资源列表查询
export async function getResources(params) {
  return request('/resource/getResources', {
    method: 'post',
    params,
  });
}

// 资源修改
export async function updateResource(params) {
  return request('/resource/updateResource', {
    method: 'post',
    params,
  });
}
